home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 101-125 / scopedisk118 / cosmicquest / defs.h < prev    next >
C/C++ Source or Header  |  1995-03-19  |  3KB  |  143 lines

  1. #define STARNO 16
  2. #define TASKNO 26
  3. #define PLANETNO 8
  4. #define PLAYERNO 4
  5. #define UNINHABITED PLAYERNO+1
  6. #define FIGHTING PLAYERNO+2
  7. #define XMAX 25
  8. #define YMAX 25
  9. #define SHIPNO 31
  10. #define INVESTING SHIPNO
  11. #define RESEARCHING SHIPNO+1
  12. #define DO_NOTHING SHIPNO+3
  13. #define MINING SHIPNO+2
  14. #define STRLENGTH 20
  15. #define SHIPNAMELENGTH 15
  16. #define ATSTAR(pla,tas,sta) (task[pla][tas].headed==sta && task[pla][tas].arriving<=general.time)
  17. #define HEADEDSTAR(pla,tas,sta) (task[pla][tas].headed==sta && task[pla][tas].arriving>general.time)
  18. #define INTASK(pla,tas,shi) (task[pla][tas].ship_free[shi]+task[pla][tas].ship_load[shi])
  19. #define MCOST 15
  20. #define ICOST 15
  21. #define RCOST 10
  22. #define MAXSPEED 10
  23. #define OREUNIT 29
  24. #define POPUNIT 30
  25. #define BUFLENGTH 50
  26.  
  27. #define BLACKPEN 0L
  28. #define GREENPEN 1L
  29. #define WHITEPEN 2L
  30. #define OTHERPEN 3L
  31. #define PLAYERPEN(n) (4L+n)
  32. #define SPRITEPEN(n) (16L+n)
  33.  
  34. struct NPlanet
  35.   {
  36.   unsigned char ruler;
  37.   unsigned char size;
  38.   unsigned char population;
  39.   unsigned char poptype;
  40.   unsigned char industry;
  41.   unsigned char producing;
  42.   unsigned int ipoints;
  43.   unsigned char mineable;
  44.   };
  45. struct NStar
  46.   {
  47.   int x;
  48.   int y;
  49.   struct NPlanet planet[PLANETNO];
  50.   };
  51. struct NTask
  52.   {
  53.   int headed;
  54.   int arriving;
  55.   unsigned char ship_free[SHIPNO];
  56.   unsigned char ship_load[SHIPNO];
  57.   };
  58. struct NShip
  59.   {
  60.   char name[SHIPNAMELENGTH];
  61.   int size;
  62.   int capacity;
  63.   int hyprange;
  64.   int hypspeed;
  65.   int speed;
  66.   int attack;
  67.   int attackno;
  68.   int shields;
  69.   int techcost;
  70.   int techlevel;
  71.   int special;
  72.   };
  73. struct StarData
  74.   {
  75.   int ruler;
  76.   int totsize;
  77.   int totpop;
  78.   int totind;
  79.   int danger;
  80.   int when;
  81.   };
  82. struct NCommData
  83.   {
  84.   struct StarData star[STARNO];
  85.   };
  86. #define NOSPEC     0
  87. #define STARKILLER 1
  88. #define KAMIKAZE   2
  89. #define INVISIBLE  4
  90. #define FASTEJECTER 8
  91. #define NOTPROD   16
  92. #define STEAL     32
  93. #define FASTEJECTABLE 64
  94. struct NGeneral
  95.   {
  96.   int time;
  97.   char pname[PLAYERNO][STRLENGTH];
  98.   int techlevel[PLAYERNO];
  99.   int relation[PLAYERNO][PLAYERNO];
  100.   };
  101. #define RELMAX 2
  102. #define RELMIN 0
  103. #define ALLIANCE 2
  104. #define WAR 1
  105. #define PEACE 0
  106. struct NCommand
  107.   {
  108.   int com;
  109.   int par[SHIPNO+10];
  110.   };
  111.  
  112. #define DUMMY 0
  113. #define CARRY 1
  114. #define DESTINATION 2
  115. #define EMIGRATION 3
  116. #define LAND 4
  117. #define JOIN 5
  118. #define KILL 6
  119. #define SPLIT 7
  120. #define PRODUCE 8
  121. #define DECLARE 9
  122. #define POSSESS 10
  123. #define ERROR 11
  124.  
  125. #define CLEAR 0
  126. #define STARSUMMARY 1
  127. #define TASKSUMMARY 2
  128. #define TASKOVERVIEW 3
  129. #define SHIPSUMMARY 4
  130. #define STAROVERVIEW 5
  131. #define PLAYERSUMMARY 6
  132. #define SHIPOVERVIEW 7
  133. #define PLANETSUMMARY 8
  134.  
  135. #define MAX(a,b) ((a)>(b)?(a):(b))
  136. #define MIN(a,b) ((a)<(b)?(a):(b))
  137. #define ABS(x) ((x<0)?(-(x)):(x))
  138. #define RANDOM(x) ((int) ((1L*(x)*(rand()&0xfff))/0x1000))
  139. #define RSGN() ((int) (rand()&0x02)-1)
  140. #define SECSET ('z'-'a'+1)
  141. #define TASKCHAR(tas) (((tas)<SECSET) ? (tas)+'a' : (tas)+'A'-SECSET)
  142. #include "proto.h"
  143.